<%@ page import="cn.edu.hbcit.text1.Student" %>
<%@ page import="cn.edu.hbcit.text1.StudentDb" %>
<%@ page import="cn.edu.hbcit.text1.Account" %>
<%@ page import="java.sql.*" %>
<%--
  Created by IntelliJ IDEA.
  User: 11507
  Date: 2019/6/20
  Time: 14:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>状态查询</title>
</head>
<body>
<div class="container">
    <%@include file="template/header.jsp" %>
    <%
        boolean tempflag = false;
        String account = request.getParameter("account");
        String password = request.getParameter("password");
        String name = request.getParameter("name");
//        System.out.println(account);
//        System.out.println(password);
//        System.out.println(name);
        Account acct = new Account();
//        acct.addAcount(account,password,name);
        tempflag = acct.addAcount(account, password, name);

        if (tempflag) {
            out.println("<div class=\"alert alert-success\">\n" +
                    "  <strong>成功!</strong> 账号创建成功。\n" +
                    "</div>");
//            response.sendRedirect("login.jsp");
        } else {
            out.print("<div class=\"alert alert-danger\">\n" +
                    "  <strong>失败!</strong> 账号已经存在或服务器异常。\n" +
                    "</div>");
//            response.sendRedirect("register.jsp");
        }
    %>
    <a href="login.jsp">
        <button type="button" class="btn btn-outline-primary">返回登陆界面</button>
    </a>
    <a href="register.jsp">
        <button type="button" class="btn btn-outline-secondary">返回注册界面</button>
    </a>
    <%@include file="template/footer.jsp" %>
</div>
<%@include file="template/link.jsp" %>
<%@include file="template/autoClick.jsp" %>
</body>
</html>
